"""
添加客户关怀页面
"""
from selenium.webdriver.common.by import By
from page.base_page import BasePage
class AddCustomerCarePage(BasePage):
    #定位器
    #客户
    kh_khgl_kh_locator = (By.ID, "customer_name")
    #联系人
    kh_khgl_lxr_locator = (By.ID, "contacts_name")
    #关怀主题
    kh_khgl_ghzt_locator = (By.ID, "name")
    #关怀日期
    kh_khgl_ghrq_locator = (By.ID, "care_time")
    #保存
    kh_khgl_bc_locator = (By.CSS_SELECTOR,
                          "body > div.container > div.row > div > form > table > thead > tr > td:nth-child(2) > input:nth-child(1)")


    #输入客户
    def input_kh(self,kh):
        self.driver.find_element(*self.kh_khgl_kh_locator).send_keys(kh)
    #输入联系人
    def input_lxr(self,lxr):
        self.driver.find_element(*self.kh_khgl_lxr_locator).send_keys(lxr)
    #输入关怀主题
    def input_ghzt(self,ghzt):
        self.driver.find_element(*self.kh_khgl_ghzt_locator).send_keys(ghzt)
    #输入关怀日期
    def input_ghrq(self,ghrq):
        self.driver.find_element(*self.kh_khgl_ghrq_locator).send_keys(ghrq)
    #点击保存
    def click_bc(self):
        self.driver.find_element(*self.kh_khgl_bc_locator).click()